package com.itheima.stock.mapper;

import com.itheima.stock.common.domian.*;
import com.itheima.stock.pojo.StockMarketIndexInfo;
import com.itheima.stock.pojo.StockRtInfo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.beans.BeanInfo;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author hyn
 * @description 针对表【stock_market_index_info(国内大盘数据详情表)】的数据库操作Mapper
 * @createDate 2022-05-30 01:02:49
 * @Entity com.itheima.stock.pojo.StockMarketIndexInfo
 */
@Repository
public interface StockMarketIndexInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockMarketIndexInfo record);

    int insertSelective(StockMarketIndexInfo record);

    StockMarketIndexInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockMarketIndexInfo record);

    int updateByPrimaryKey(StockMarketIndexInfo record);

    /**
     * 查询所有Market信息
     *
     * @return
     */
    List<InnerMarket> queryAllMaket(@Param("marketIds") List<String> marketIds, @Param("curTime") Date curTime);

    /**
     * 查询沪深的股票交易量
     *
     * @param
     * @param startTimePoint 开始时间
     * @param endTimePoint   结束时间
     * @param inners
     * @return List
     */
    @MapKey("id")
    List<Map> queryAllMarketInfoUpDown(@Param("startTime") Date startTimePoint, @Param("endTime") Date endTimePoint, @Param("code") String code);

    @MapKey("id")
    List<Map> queryAllStockGainByDate(@Param("date") Date recentTimePoint);

    List<Stock4MinuteDomain> qureyStockTimeSharing(@Param("code") String code,@Param("startTime") Object startTimePoint,@Param("endTime") Object endTimePoint);

    List<Stock4MinuteDomain> queryDayKLine(@Param("code") String code,@Param("dates") List<Date> maxTimes,@Param("beginTime") Object beginTime, @Param("endTime") Object endTime);

    void insertInnerStockData(@Param("list") List<StockMarketIndexInfo> infos);


    void insertInnerStockIndexData(@Param("list") List<StockRtInfo> infos);


    @MapKey("id")
    List<Map> queryAllACode(@Param("codeA") String searchStr);

    StockWeekLineDomain queryWeekLine(@Param("code") String code,@Param("maxTime") Date maxTime,@Param("minTim") Date minTim);

    StockRtIndexInfoDomain queryTheLatestTimeSharingQuotationOfIndividualStocks(@Param("code") String code,@Param("date") Date date);

    List<StockFlowDomain> queryGStockFlow(@Param("code") String code);

    List<Date> selectMaxTime(@Param("code") String code,@Param("beginTim") Object beginTim,@Param("endTim") Object endTim);

    List<StockWeekDomain> selectAllData(@Param("code") String code,@Param("beginTim") Object beginTim,@Param("endTim") Object endTim);
}
